﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.NumericalIntegration
{
    /// <summary>
    /// This class represents a complex infinity integral. The integral may specified from -infinity to a 
    /// specified bound, from a specified bound to +infinity or from -infinity to +infinity.
    /// </summary>
    [Serializable]
    public class ComplexInfinityIntegral : IComplexInfinityIntegral
    {
        /// <summary>
        /// The bound of the integral which is not infinity.
        /// </summary>
        private ComplexNumber bound;

        /// <summary>
        /// The range of the integral.
        /// </summary>
        private IntegralRange range;

        /// <summary>
        /// The function of the integral.
        /// </summary>
        private IComplexFunction function;

        /// <summary>
        /// Initializes a new instance of the <see cref="ComplexInfinityIntegral"/> class.
        /// </summary>
        /// <param name="range">The range of the integral.</param>
        /// <param name="function">The function of the integral.</param>
        public ComplexInfinityIntegral(IntegralRange range, IComplexFunction function)
        {
            this.range = range;
            this.function = function;
            this.bound = new ComplexNumber();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ComplexInfinityIntegral"/> class.
        /// </summary>
        /// <param name="range">The range of the integral.</param>
        /// <param name="bound">The bound of the integral which is not infinity.</param>
        /// <param name="function">The function of the integral.</param>
        public ComplexInfinityIntegral(IntegralRange range, ComplexNumber bound, IComplexFunction function)
        {
            this.bound = bound;
            this.range = range;
            this.function = function;
        }

        /// <summary>
        /// Gets or sets the bound of the integral which is not infinity.
        /// </summary>
        /// <value>The bound of the integral which is not infinity.</value>
        public ComplexNumber Bound
        {
            get { return bound; }
            set { bound = value; }
        }

        /// <summary>
        /// Gets or sets the range of the integral.
        /// </summary>
        /// <value>The range of the integral.</value>
        public IntegralRange Range
        {
            get { return range; }
            set { range = value; }
        }

        /// <summary>
        /// Gets or sets the function of the integral.
        /// </summary>
        /// <value>The function of the integral.</value>
        public IComplexFunction Function
        {
            get { return function; }
            set { function = value; }
        }
    }
}
